<div class="make-bom">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>芯级配套汇总</span>
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <!-- <div class="p-formgroup-inline">
                    <span class="p-field ml">
                        <span class="input-lable">型号：</span>
                        <p-dropdown filter="true" name="model" #lotNoSelect="ngModel" [options]="createModelOption"
                            [(ngModel)]="createModel" dataKey="value" [optionLabel]="'label'" placeholder="请选择" (onChange)="onChange($event)">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">发次：</span>
                        <p-dropdown filter="true" name="lotNoList" #lotNoSelect="ngModel" [options]="createLotNoList"
                            [(ngModel)]="createLotNo" dataKey="value" [optionLabel]="'label'"
                            (onChange)="getCoreListCreate($event,1)" placeholder="请选择">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">芯级：</span>
                        <p-dropdown filter="true" name="sstroeName" [options]="createCoreList" placeholder="请选择芯级"
                            [(ngModel)]="createCore" emptyFilterMessage="暂无数据">
                            <ng-template let-item pTemplate="selectedItem">
                                <span *ngIf="createCore != undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                <span *ngIf="createCore == undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;"> </span>
                            </ng-template>
                            <ng-template let-model pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">{{model.label}}
                                    </div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </span>
                </div> -->
                <div class="p-formgroup-inline" style="margin-top:20px;">
                    <span class="p-field ml">
                        <span class="input-lable">型号：</span>
                        <p-dropdown filter="true" name="sstroeName" [options]="modelOption"
                            [(ngModel)]="model" dataKey="value" [optionLabel]="'label'" placeholder="请选择" (onChange)="getLotNo($event)">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">发次：</span>
                        <p-dropdown filter="true" name="sstroeName" #lotNoSelect="ngModel" [options]="LotNoList"
                            [(ngModel)]="lotNo" dataKey="value" [optionLabel]="'label'"
                            (onChange)="getCoreList($event,2)" placeholder="请选择">
                        </p-dropdown>
                    </span>
                    <span class="p-field ml">
                        <span class="input-lable">芯级：</span>
                        <p-dropdown filter="true" name="sstroeName" [options]="coreList" placeholder="请选择芯级"
                            [(ngModel)]="core" emptyFilterMessage="暂无数据" (onChange)="getCoreList($event,2)">
                            <ng-template let-item pTemplate="selectedItem">
                                <span *ngIf="core != undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                <span *ngIf="core == undefind "
                                    style="vertical-align:middle; margin-left: .5em;width: 147px;"> </span>
                            </ng-template>
                            <ng-template let-model pTemplate="item">
                                <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                    <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">{{model.label}}
                                    </div>
                                </div>
                            </ng-template>
                        </p-dropdown>
                    </span>
                    <p-button *ngIf="'Pages.CoreSummary.GenerateList' | permission" label="生成更新汇总清单" (onClick)="createBom()" class="ml"></p-button>
                    <p-button label="查询" (onClick)="getTableList()" class="ml"></p-button>
                    <p-button label="重置" (onClick)="reset()" class="ml"></p-button>
                </div>
                <div class="row align-items-center" style="margin-top: 25px;">
                    <div class="primeng-datatable-container">
                        <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getTableList($event)"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 100px">操作</th>
                                    <th style="width: 80px;">序号</th>
                                    <th style="width: 150px">型号</th>
                                    <th style="width: 150px">发次</th>
                                    <th style="width: 150px">芯级</th>
                                    <th style="width: 150px">芯级图号</th>
                                    <th style="width: 150px">创建人</th>
                                    <th style="width: 150px">创建日期</th>
                                    <th style="width: 150px">更新日期</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                                <tr>
                                    <td style="width: 100px">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu>
                                                <li>
                                                    <a *ngIf="'Pages.CoreSummary.Resume' | permission" href="javascript:;" (click)="look(record)">履历</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.CoreSummary.BOMView' | permission" href="javascript:;" (click)="watch(record)">BOM查看</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 80px;">{{rowIndex+1}}</td>
                                    <td style="width: 150px">{{record.module}}</td>
                                    <td style="width: 150px">{{record.sendTime}}</td>
                                    <td style="width: 150px">{{record.xjName}}</td>
                                    <td style="width: 150px">{{record.xjDrawingNo}}</td>
                                    <td style="width: 150px">{{record.createUserName}}</td>
                                    <td style="width: 150px">{{record.creationTime | momentFormat:'YYYY-MM-DD
                                        HH:mm:ss'}}</td>
                                    <td style="width: 150px">{{record.lastModificationTime | momentFormat:'YYYY-MM-DD
                                        HH:mm:ss'}}</td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getTableList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 履历 -->
    <app-resume #showResume [parentInfo]="rowdata"></app-resume>
    <!-- 查看 -->
    <app-bom-look #bomLook [parentInfo]="rowdata"></app-bom-look>
    <!-- 制造同步 -->
</div>